package com.lsq.tucao.express.controller;

import com.alibaba.fastjson.JSONObject;
import com.lsq.tucao.express.service.NewsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/news")
public class NewController {

    @Autowired
    private NewsService newsService;

    /**
     * @author lsq
     * @description 调用第三方接口 获取热点新闻
     * @return com.alibaba.fastjson.JSONObject
     * @create 2021/4/23 20:22
     */
    @GetMapping
    public JSONObject getTopNews(){
        return newsService.getTopNews();
    }

}
